package com.acorn.community.common.api;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @className: PageReq
 * @description: 分页查询参数结构
 * @author: huayandong
 * @date: 2021/12/12
 **/
public class PageReq {

    @JsonProperty(value = "page_index")
    private int pageIndex = 1;

    @JsonProperty(value = "page_size")
    private int pageSize = 10;

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        if (pageIndex == 0) {
            pageIndex = 1;
        }
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize == 0) {
            pageSize = 10;
        }
        this.pageSize = pageSize;
    }
}
